package com.esyoga.yoyoga.service.impl;

import com.esyoga.yoyoga.mapper.TInformMapper;
import com.esyoga.yoyoga.pojo.TInform;
import com.esyoga.yoyoga.pojo.TInformExample;
import com.esyoga.yoyoga.service.NewshintService;
import lombok.Data;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Data
@Service
public class NewshintServiceImpl implements NewshintService {

    @Resource
    TInformMapper tInformMapper;

    @Resource
    TInformExample tInformExample;

    @Override
    public List<TInform> showNews(Integer userid, Integer usertype) {
        tInformExample.clear();
        TInformExample.Criteria criteria = tInformExample.createCriteria();
        criteria.andIUseridEqualTo(userid);
        criteria.andIUsertypeEqualTo(usertype);
        criteria.andIStateEqualTo(1);
        return tInformMapper.selectByExample(tInformExample);
    }
}
